Apparatus and method for storing data traffic on flow basis

ABSTRACT

An apparatus and method for storing data traffic on a flow basis. The apparatus for storing data traffic on a flow basis includes a packet storage unit a flow generation unit, and a metadata generation unit. The packet storage unit receives packets corresponding to data traffic, and temporarily stores the packets using queues. The flow generation unit generates flows by grouping the packets by means of a hash function using information about each of the packets as input, and to store the flows. The metadata generation unit generates metadata and index data corresponding to each of the flows, and stores the metadata and the index data.

CROSS-REFERENCE TO RELATED APPLICATION

This application claims the benefit of Korean Patent Application No.10-2015-0093992, filed Jul. 1, 2015, which is hereby incorporated byreference herein in its entirety.

BACKGROUND

1. Technical Field

Embodiments of the present invention relate generally to technology forstoring data traffic, and more particularly to technology for storingand searching for data traffic on the basis of a flow composed ofpackets that constitute the data traffic.

2. Description of the Related Art

Systems for storing and searching for data traffic collect data trafficthat enters a specific router or switch interface. Of conventionalsystems, Netflow of Cisco Systems, Inc. in the U.S. has become the defacto standard in the related industry because it is equipped with mostfunctions including the functions of storing and searching for packets.However, Netflow requires a high-performance router or network switchcompatible with Netflow in order to process a large amount of high-speeddata traffic. Furthermore, when Netflow is used as a system for storingand searching for data traffic, Netflow has a problem in that indexingand searching efficiency is low because data traffic is stored on apacket basis. Furthermore, most commercial systems for storing andsearching for data traffic suffer from problems attributable to highcosts, lack of versatility of application, and packet-based storage andsearch.

Korean Patent Application Publication No. 2013-0093832 discloses amethod of processing data traffic using a multi-network interface card.In greater detail, this patent publication discloses technology forexamining each of the packets of data traffic and discarding a packetthat does not comply with network policies.

Nevertheless, the technology disclosed in Korean Patent ApplicationPublication No. 2013-0093832 also merely examines the inside of datatraffic based on a packet unit, and does not teach processing on thebasis of a flow unit composed of packets.

Accordingly, there is a need for technology capable of minimizing thetime it takes to process data traffic, in light of the fact thatrecently, problems attributable to an explosive increase in data traffichave increased.

SUMMARY

At least one embodiment of the present invention is intended to storeand search for data traffic on the basis of a flow unit composed ofpackets.

At least one embodiment of the present invention is intended to searchfor data traffic on the basis of two-step flow-based index data.

In accordance with an aspect of the present invention, there is providedan apparatus for storing data traffic on a flow basis, including: apacket storage unit configured to receive packets corresponding to datatraffic, and to temporarily store the packets using queues; a flowgeneration unit configured to generate flows by grouping the packets bymeans of a hash function using information about each of the packets asinput, and to store the flows; and a metadata generation unit configuredto generate metadata and index data corresponding to each of the flows,and to store the metadata and the index data.

The flow generation unit may include: a hash value generation unitconfigured to generate a hash value based on the IP address of eachsender, the IP address of each recipient, the port address of thesender, and the port address of the recipient, which correspond to thepackets; a generation unit configured to sort the packets according totheir flows based on the hash values, to generate flows by grouping thepackets, and to store the flows in flow buffers; and a flow storage unitconfigured to store the flows, stored in the flow buffers, on harddisks.

The flow storage unit may store each of the flows on the hard disks whenthe size of the flow stored in the flow buffers exceeds a specific valueor the flow is terminated.

The flow buffers may include: an upstream content buffer configured tostore a request packet; a header buffer configured to store the headerof a response packet corresponding to the request, packet; anddownstream content buffers configured to store the body of the responsepacket.

The downstream content buffers may include an HTTP response headerbuffer configured to store response headers of packets corresponding toHTTP data traffic; and an HTTP response body buffer configured to storesthe response bodies of the packets.

The flow storage unit may store the address of internal data of a bodycorresponding to a first flow in a flow data map inside a second flowwhen the internal data of the body corresponding to the first flow isthe same as the internal data of a body corresponding to the secondflow.

The metadata generation unit may generate the metadata including the IPaddress of a sender, the IP address of a recipient, the port address ofthe sender, the port address of the recipient, the internal address of ahard disk on which the flow has been stored, and the start time and endtime of the flow, which correspond to the flow, and the index dataincluding the IP address of the sender, the IP address of the recipient,the port address of the sender, and the port address of the recipient,which correspond to the flow.

The metadata and the index data may be stored on a solid state drive(SSD), and the data traffic may be stored on the hard disks.

In accordance with another aspect of the present invention, there isprovided an apparatus for searching for data traffic on a flow basis,including: a flow storage unit configured to store flows generated byarranging packets corresponding to data traffic using information abouteach of the packets and a hash function; a metadata storage unitconfigured to store metadata and index data corresponding to each of theflows; and a search unit configured to search for a flow stored in theflow storage unit based on information about the flow.

The search unit may include a Bloom filter configured to store the IPaddress of a sender, the IP address of a recipient, the port address ofthe sender, and the port address of the recipient, which correspond tothe flow.

The search unit may determine whether a flow is present in the flowstorage unit using any one of the IP address of the sender, the IPaddress of the recipient, the port address of the sender, and the portaddress of the recipient, which correspond to the flow, and the Bloomfilter.

If it is determined using the Bloom filter that the flow is present, thesearch unit may search for metadata corresponding to the flow using theindex data, and then may search for the flow based on the metadata.

The flow storage unit may store the flows on hard disks.

The metadata storage unit may store the metadata and the index data on asolid state drive (SSD).

In accordance with still another aspect of the present invention, thereis provided a method of storing data traffic on a flow basis, including:receiving packets corresponding to data traffic, and temporarily storingthe packets using queues; generating flows by arranging the packetsusing information about each of the packets and a hash function, andstoring the flows; and generating metadata and index data correspondingto each of the flows.

Generating the flows may include: generating a hash value based on theIP address of each sender, the IP address of each recipient, the portaddress of the sender, and the port address of the recipient, whichcorrespond to the packets; generating flows by grouping the packetsbased on the hash values, and storing the flows in flow buffers; andstoring the flows, stored in the flow buffers, on hard disks.

Storing the flows may include storing each of the flows on the harddisks when the size of the flow stored in the flow buffers exceeds aspecific value or the flow is terminated.

The flow buffers may include: an upstream content buffer configured tostore a request packet; a header buffer configured to store the headerof a response packet corresponding to the request packet; and downstreamcontent buffers configured to store the body of the response packet.

The downstream content buffers may include an HTTP response headerbuffer configured to store response headers of packets corresponding toHTTP data traffic; and an HTTP response body buffer configured to storesthe response bodies of the packets.

Storing the flows may include storing an address of internal data of abody corresponding to a first flow in a flow data map inside a secondflow when the internal data of the body corresponding to the first flowis identical to internal data of a body corresponding to the secondflow.

Generating the metadata and the index data may include generating themetadata including the IP address of a sender, the IP address of arecipient, the port address of the sender, the port address of therecipient, the internal address of a hard disk on which the flow hasbeen stored, and the start time and end time of the flow, whichcorrespond to the flow, and the index data including the IP address ofthe sender, the IP address of the recipient, the port address of thesender, and the port address of the recipient, which correspond to theflow.

Generating the metadata and the index data may include storing thegenerated metadata and index data on a solid state drive (SSD).

BRIEF DESCRIPTION OF THE DRAWINGS

The above and other objects, features and advantages of the presentinvention will be more clearly understood from the following detaileddescription taken in conjunction with the accompanying drawings, inwhich:

FIG. 1 is a block diagram showing an apparatus for storing data trafficon a flow basis according to an embodiment of the present invention;

FIG. 2 is a block diagram showing an embodiment of the flow generationunit shown in FIG. 1;

FIG. 3 is a diagram showing an apparatus for storing data traffic on aflow basis according to an embodiment of the present invention;

FIG. 4 is a diagram showing the storage of flows using an apparatus forstoring data traffic on a flow basis according to an embodiment of thepresent invention;

FIG. 5 is a block diagram showing an apparatus for searching for datatraffic on a flow basis according to an embodiment of the presentinvention;

FIG. 6 is a diagram showing search for a flow using an apparatus forsearching for data traffic on a flow basis according to an embodiment ofthe present invention; and

FIG. 7 is an operation flowchart showing a method of storing datatraffic on a flow basis according to an embodiment of the presentinvention.

DETAILED DESCRIPTION

Embodiments of the present invention will be described in detail belowwith reference to the accompanying drawings. Redundant descriptions anddescriptions of well-known functions and configurations that have beendeemed to make the gist of the present invention unnecessarily obscurewill be omitted below. The embodiments of the present invention areintended to fully describe the present invention to persons havingordinary knowledge in the art to which the present invention pertains.Accordingly, the shapes, sizes, etc. of components in the drawings maybe exaggerated to make the description obvious.

Embodiments of the present invention are described in detail withreference to the accompanying diagrams.

FIG. 1 is a block diagram showing an apparatus for storing data trafficon a flow basis according to an embodiment of the present invention.

A packet storage unit 110 receives packets corresponding to datatraffic, and temporarily stores the packets using queues.

In this case, a high-speed Network Interface Card (NIC) may receive thepackets corresponding to the data traffic.

In this case, the efficiency of communication between threads and a diskwrite task can be increased by temporarily storing the packets using thequeues and transferring the temporarily stored packets at one timewithout transmitting the received packets to a CPU and processing them.

A flow generation unit 120 generates flows by arranging packets usinginformation about each of the packets and a hash function, and storesthe flows.

In this case, arranging packets refers to grouping packets that are usedwhen a single task is performed.

In this case, the term “flow” used herein may refer to a set of packetsthat are used to perform a single task.

In this case, when generating the flows by arranging the packets, theflow generation unit 120 may generate the flows by arranging the packetsusing information about each of the packets and hash values generatedusing a hash function.

In this case, a method of arranging packets is not limited to a specificmethod. When hash values generated from respective packets are the same,a single flow may be generated by arranging packets having the same hashvalue.

In this case, the information about each of the packets may beinformation including the IP address of a sender, the IP address of arecipient, the port address of the sender, and the port address of therecipient, which correspond to the packet.

In this case, the flow generation unit 120 may temporarily store thegenerated flows in flow buffers. When the size of data stored in theflow buffers exceeds a specific value or a flow is terminated, the flowstemporarily stored in the flow buffers may be transmitted to hard disksand stored on the hard disks. There is no limitation regarding thespecific value. When more frequent movement from the flow buffers to thehard disks is required, the specific value may be adjusted to a smallervalue. In contrast, when the efficiency of transmission to the harddisks is increased, the specific value is adjusted to a larger value,and thus a larger amount of data may be transmitted at one time.

In this case, the flow buffers in which the flows are temporarily storedinclude a packet header buffer configured to store the headers of allthe packets of a corresponding flow that is temporarily stored, anupstream content buffer configured to store the payload of a requestpacket, and downstream content buffers configured to store the payloadof a response packet corresponding to the request packet. The downstreamcontent buffers include an HTTP response header buffer configured tostore an HTTP response header and an HTTP response body bufferconfigured to store an HTTP response body, in the case of HTTP datatraffic. Although a conventional buffer stores both a request packet anda response packet in a single buffer without dividing each packet into aheader and a payload, the flow buffers used in the present inventioninclude the header buffer, the upstream content buffer and thedownstream content buffers in order to separately store the header andthe payload of the packet.

In this case, the flow storage unit 120 stores the address of theinternal data of a body corresponding to a first flow in a flow data mapinside a second flow when the internal data of the body corresponding tothe first flow is the same as the internal data of a body correspondingto the second flow. This is intended to increase the efficiency ofstorage space. To prevent the waste of storage space that occurs whenall redundant data is stored, when redundant data is present in theinternal body data of the response packets inside flows, the redundantdata is eliminated from a flow, and the address of the same data storedin another flow is stored in a flow data map inside the other flow. Thisis described in detail with reference to FIG. 4.

The metadata generation unit 130 generates metadata and index datacorresponding to each flow.

In this case, the metadata may include the IP address of a sender, theIP address of a recipient, the port address of the sender, the portaddress of the recipient, the internal address of a hard disk on whichthe flow has been stored, and the start time and end time of the flow,which correspond to the flow.

In this case, the index data may include the IP address of the sender,the IP address of the recipient, the port address of the sender, and theport address of the recipient.

In this case, the index data may include the IP address of the sender,the IP address of the recipient, the port address of the sender, and theport address of the recipient among the data included in the metadata.When the metadata is directly used to search for a flow, a reduction insearch speed may occur because the size of metadata is large.Accordingly, a reduction in search speed can be prevented using a methodof determining a search target flow using the index data in which partof the metadata has been stored and then fetching the address of thehard disk at which the flow has been stored using the metadata.

In this case, processing speed can be improved by storing the index dataand the metadata on a solid state drive (SSD), instead of the harddisks.

FIG. 2 is a block diagram showing an embodiment of the flow generationunit shown in FIG. 1.

Referring to FIG. 2, the flow generation unit 120 includes a hash valuegeneration unit 210, a generation unit 220, and a flow storage unit 230.

The hash value generation unit 210 generates a hash value by applying ahash function using the IP address of the sender, the IP address of therecipient, the port address of the sender, and the port address of therecipient, corresponding to a packet, as input.

In this case, the hash function refers to an algorithm that maps data ofan arbitrary length to data of a fixed length. The hash function has acharacteristic in which input varies when a hash value varies.Accordingly, it is possible to group packets and generate a flow using ahash value generated by applying the hash function to an input value.

The generation unit 220 sorts packets according to their flows based onthe hash values, generates flows by grouping the packets, and stores theflows in the flow buffers.

In this case, although a method of sorting packets according to theirflows is not limited to a specific method, flows may be generated bygrouping packets having the same hash value.

In this case, the generation unit 220 may temporarily store thegenerated flows in the flow buffers. When the size of data stored in theflow buffers exceeds a specific value or a flow is terminated, the flowstemporarily stored in the flow buffers may be transmitted to hard disksand stored on the hard disks. There is no limitation regarding thespecific value. When more frequent movement from the flow buffers to thehard disks is required, the specific value may be adjusted to a smallervalue. In contrast, when the efficiency of transmission to the harddisks is increased, the specific value is adjusted to a larger value,and thus a larger amount of data may be transmitted at one time.

In this case, the flow buffers in which the flows are temporarily storedinclude a packet header buffer configured to store the headers of allthe packets of a corresponding flow that is temporarily stored, anupstream content buffer configured to store the payload of a requestpacket, and downstream content buffers configured to store the payloadof a response packet corresponding to the request packet. The downstreamcontent buffers include an HTTP response header buffer configured tostore an HTTP response header and an HTTP response body bufferconfigured to store an HTTP response body, in the case of HTTP datatraffic. Although a conventional buffer stores both a request packet anda response packet in a single buffer without dividing each packet into aheader and a payload, the flow buffers used in the present inventioninclude the header buffer, the upstream content buffer and thedownstream content buffers in order to separately store the header andthe payload of the packet.

The flow storage unit 230 stores the flows, stored in the flow buffers,on hard disks.

In this case, the flow storage unit 230 stores the address of theinternal data of a body corresponding to a first flow in a flow data mapinside a second flow when the internal data of the body corresponding tothe first flow is the same as the internal data of a body correspondingto the second flow. This is intended to increase the efficiency ofstorage space. To prevent the waist of storage space that occurs whenall redundant data is stored, when redundant data is present in theinternal body data of the response packets inside flows, the redundantdata is eliminated from a flow, and the address of the same data storedin another flow is stored in a flow data map inside the other flow. Thisis described in detail with reference to FIG. 4.

FIG. 3 is a diagram showing an apparatus for storing data traffic on aflow basis according to an embodiment of the present invention.

The packet storage unit 110, the flow generation unit 120 and themetadata generation unit 130 shown in FIG. 1 may be implemented usingthreads within a central processing unit (CPU).

First, the threads within the CPU may include three types of threads:engine threads 330, writing threads 340, and index threads 350.

The engine threads 330 may be responsible for the detection of packetsfrom the high-speed NIC 310, the generation of flows, the management offlows, and the generation of index data.

The writing threads 340 may be responsible for the periodical storage offlow data, present in the flow buffers on hard disks 350. In this case,the writing thread 340 may share the flow buffers with the enginethreads 330.

The index threads 360 may be responsible for the storage of metadata andindex data corresponding to each of the flows on an SSD 370. In thiscase, the index threads 360 share the metadata and index data of theflows with the engine threads 330.

Referring to FIG. 3, the storage of flows by the apparatus for storingdata traffic on a flow basis according to an embodiment of the presentinvention is described.

First, the packet storage unit 110 receives packets corresponding todata traffic from the NIC 310, and temporarily stores the packets usingqueues 320.

In this case, the packet storage unit 110 may be performed using theengine threads 330.

In this case, the efficiency of communication between threads and a diskwrite task can be increased by temporarily storing the packets using thequeues and transferring the temporarily stored packets, at one timewithout transmitting the received packets to a CPU and processing them.

Furthermore, the flow generation unit 120 generates flows by, arrangingpackets using information about each of the packets and a hash function,and stores the generated flows on the hard disks 350.

In this case, the flow generation unit 120 may generate flows usingengine threads 330, and may store the flows on the hard disks 350 usingthe writing threads 340.

In this case, arranging packets refers to grouping packets that are usedwhen a single task is performed.

In this case, the term “flow” used herein may refer to a set of packetsthat are used to perform a single task.

In this case, when generating the flows by arranging the packets, theflow generation unit 120 may generate the flows by arranging the packetsusing information about each of the packets and hash values generatedusing a hash function.

In this case, a method of arranging packets is not limited to a specificmethod. When hash values generated from respective packets are the same,a single flow may be generated by arranging packets having the same hashvalue.

In this case, the information about each of the packets may beinformation including the IP address of a sender, the IP address of arecipient, the port address of the sender, and the port address of therecipient, which correspond to the packet.

Furthermore, the metadata generation unit 130 may generate metadata andindex data corresponding to each of the flows, and may store themetadata and index data on the SSD 370.

In this case, the metadata generation unit 130 may generate the metadataand index data using the engine threads 330, and may store the metadataand index data on the SSD 370 using the index thread.

In this case, the metadata may include the IP address of a sender, theIP address of a recipient, the port address of the sender, the portaddress of the recipient, the internal address of a hard disk on whichthe flow has been stored, and the start time and end time of the flow,which correspond to the flow.

In this case, the index data may include the IP address of the sender,the IP address of the recipient, the port address of the sender, and theport address of the recipient.

In this case, the index data may include the IP address of the sender,the IP address of the recipient, the port address of the sender, and theport address of the recipient among the data included in the metadata.When the metadata is directly used to search for a flow, a reduction insearch speed may occur because the size of metadata is large.Accordingly, a reduction in search speed can be prevented using a methodof determining a search target flow using the index data in which partof the metadata has been stored and then fetching the address of thehard disk at which the flow has been stored using the metadata.

FIG. 4 is a diagram showing the storage of flows using an apparatus forstoring data traffic on a flow basis according to an embodiment of thepresent invention.

Referring to FIG. 4(a), in the case of TCP data traffic, packets aredivided and stored in a header buffer, an upstream content buffer, and adownstream content buffer. In this case, the headers of packetscorresponding to TCP data traffic may be stored in the header buffer,the payload of a request packet is stored in the upstream contentbuffer, and the payload of a response packet may be stored in thedownstream content buffer.

Furthermore, in the present invention, in the case of HTTP data traffic,the payloads of response packets are divided into HTTP response headersand bodies. The HTTP response headers are stored in a HTTP responseheader buffer, and the HTTP response bodies are stored in an HTTPresponse body buffer. The downstream content buffers may include theHTTP response header buffer and the I-ITTP response body buffer.Referring to the HTTP flow of FIG. 4(b), it can be seen that the HTTPresponse headers and bodies are separately stored in the downstreamcontent buffers. That is, it can be seen that flow data used in thepresent invention includes a flow data map, request packets, and theheaders and bodies of response packets corresponding to the requestpackets.

The flow storage unit 230 of the flow generation unit 120 may storetemporarily stored flow data on the hard disks, and packet headers maybe stored in the order in which the packets of each flow are received.The flow data stored on the hard disks is shown at the lower end of FIG.4.

In this case, the flow storage unit 120 stores the address of theinternal data of a body corresponding to a first flow in a flow data mapinside a second flow when the internal data of the body corresponding tothe first flow is the same as the internal data of a body correspondingto the second flow. This is intended to increase the efficiency ofstorage space. To prevent the waste of storage space that occurs whenall redundant data is stored, when redundant data is present in theinternal body data of the response packets inside flows, the redundantdata is eliminated from a flow, and the address of the same data storedin another flow is stored in a flow data map inside the other flow.

Referring to FIG. 4, this is described in greater detail.

In the case of the HTTP flow and the redundant data of the HTTP flowshown in FIG. 4, the body parts of response packets are the same. Inthis case, when data redundant between flow (b) and flow (c) is allstored, a problem arises in that storage space is wasted. Accordingly,data indicative of the location of redundant data is stored in a flowdata map that constitutes part of flow data. From FIG. 4, it can be seenthat redundant data is not stored in flow (c) but is stored in flow (b).In this case, data indicative of a location at which the internalredundant data of flow (b) has been stored may be stored in the flowdata map of flow (c).

In the case of HTTP data traffic, request packets to response packetsare the same, and thus the waste of storage space can be significantlyreduced when the method shown in FIG. 4 is used.

FIG. 5 is a block diagram showing an apparatus for searching for datatraffic on a flow basis according to an embodiment of the presentinvention.

Referring to FIG. 5, the apparatus for searching for data traffic on aflow basis according to the present embodiment includes a flow storageunit 510, a metadata storage unit 520, and a search unit 530.

The flow storage unit 510 stores flows generated by arranging packetsusing information about each of the packets corresponding to datatraffic and a hash function.

In this case, the stored flows may be flows generated by the apparatusfor storing data traffic on a flow basis, which is shown in FIG. 1.

In this case, the flows may be stored on the hard disks.

The metadata storage unit 520 stores metadata and index datacorresponding to each of the flows.

In this case, the stored metadata and index data may be metadata andindex data generated by the apparatus for storing data traffic on a flowbasis, which is shown in FIG. 1.

In this case, the metadata and the index data may be stored on an SSD inorder to improve search speed.

In this case, the metadata may include the IP address of a sender, theIP address of a recipient, the port address of the sender, the portaddress of the recipient, the internal address of a hard disk on whichthe flow has been stored, and the start time and end time of the flow,which correspond to the flow.

In this case, the index data may include the IP address of the sender,the IP address of the recipient, the port address of the sender, and theport address of the recipient.

The search unit 530 searches for the flow, stored in the flow storageunit 510, based on the information of the flow, the metadata and theindex data.

In this case, the search unit 530 may search for metadata correspondingto the search target specific flow using the information of the flowincluding any one of the IP address of the recipient, the IP address ofthe sender, the port address of the recipient, and the port address ofthe sender and the index data including the IP address of the recipient,the IP address of the sender, the port address of the recipient, and theport address of the sender.

In this case, the search unit 530 may extract the address of the harddisk where a flow included in metadata corresponding to a specific flowhas been stored, and may search for an internal flow inside the harddisk.

In this case, the search unit 530 may include a Bloom filter includingthe IP address of the sender, the IP address of the recipient, the portaddress of the sender, and the port address of the recipient, whichcorrespond to the flow, in order to improve search speed.

In this case, the Bloom filter is a filter that is capable ofdetermining whether information is not present. Whether information ispresent cannot be determined, and whether information is present can beestimated. A detailed description of the Bloom filter is omitted.

In this case, the search unit 530 may determine whether a search targetflow is present using the Bloom filter. If a flow is not present, searchmay be terminated. If it is determined using the Bloom filter that aflow is present, this is not accurate information, and thus it isdetermined using the index data whether the flow is present. If the flowis present, the address of the hard disk where the flow has been storedis extracted from metadata corresponding to the flow, and then the flowmay be searched for.

That is, since the Bloom filter can rapidly determine that a flow is notpresent, the present invention can effectively increase search speed.

FIG. 6 is a diagram showing search for a flow using an apparatus forsearching for data traffic on a flow basis according to an embodiment ofthe present invention.

Referring to FIG. 6, a Bloom filter, sorted arrays in which index datais arranged, flow metadata and flow data are shown.

In this case, the Bloom filter may be stored in memory and thus it canbe rapidly determined whether a flow is not present.

In this case, the index data and the flow metadata may be stored in theSSD.

In this case, the flow data may be stored on the hard disks.

In this case, in the Bloom filter, the IP address of the sender, the IPaddress of the recipient, the port address of the sender, and the portaddress of the recipient are separate from one another, and thus it maybe rapidly determined based on only the IP address 610 of a senderwhether a flow is not present.

Referring to FIG. 6, search for a flow according to an embodiment of thepresent invention is described.

First, it is determined whether a flow is not present using the input IPaddress of a sender and the Bloom filter 610. If, as a result of thedetermination, it is determined that the flow is not present, search isterminated.

Furthermore, if, as a result of the determination, it is determined thatthe flow is present, this information is not accurate information, andthus it is determined using index data whether the flow is present. Inthe case of FIG. 6, it is determined that flow 3 is present, the addressof the hard disk where flow 3 has been stored is extracted frommetadata, and packets corresponding to flow 3 may be searched for usingthe address of the hard disk.

FIG. 7 is an operation flowchart showing a method of storing datatraffic on a flow basis according to an embodiment of the presentinvention.

Referring to FIG. 7, packets corresponding to data traffic are receivedand the packets are temporarily stored using queues at step S710.

In this case, a high-speed Network Interface Card (NIC) may receive thepackets corresponding to the data traffic.

In this case, the efficiency of communication between threads and a diskwrite task can be increased by temporarily storing the packets using thequeues and transferring the temporarily stored packets at one timewithout transmitting the received packets to a CPU and processing them.

In this case, step S710 may be performed by the packet storage unit 110shown in FIG. 1.

Furthermore, hash values may be generated using packet information and ahash function at step S720.

In this case, the hash function refers to an algorithm that maps data ofan arbitrary length to data of a fixed length. The hash function has acharacteristic in which input varies when a hash value varies.Accordingly, it is possible to group packets and generate a flow using ahash value generated by applying the hash function to an input value.

Furthermore, flows are generated by arranging the packets using the hashvalues and are stored at step S730.

In this case, arranging packets refers to grouping packets that are usedwhen a single task is performed.

In this case, the term “flow” used herein may refer to a set of packetsthat are used to perform a single task.

In this case, when generating the flows by arranging the packets, theflow generation unit 120 may generate the flows by arranging the packetsusing information about each of the packets and hash values generatedusing a hash function.

In this case, a method of arranging packets is not limited to a specificmethod. When hash values generated from respective packets are the same,a single flow may be generated by arranging packets having the same hashvalue.

In this case, the information about each of the packets may beinformation including the IP address of a sender, the IP address of arecipient, the port address of the sender, and the port address of therecipient, which correspond to the packet.

In this case, the flow generation unit 120 may temporarily store thegenerated flows in flow buffers. When the size of data stored in theflow buffers exceeds a specific value or a flow is terminated, the flowstemporarily stored in the flow buffers may be transmitted to hard disksand stored on the hard disks. There is no limitation regarding thespecific value. When more frequent movement from the flow buffers to thehard disks is required, the specific value may be adjusted to a smallervalue. In contrast, when the efficiency of transmission to the harddisks is increased, the specific value is adjusted to a larger value,and thus a larger amount of data may be transmitted at one time.

In this case, the flow buffers in which the flows are temporarily storedinclude a packet header buffer configured to store the headers of allthe packets of a corresponding flow that is temporarily stored, anupstream content buffer configured to store the payload of a requestpacket, and downstream content buffers configured to store the payloadof a response packet corresponding to the request packet. The downstreamcontent buffers include an HTTP response header buffer configured tostore an HTTP response header and an HTTP response body bufferconfigured to store an HTTP response body, in the case of HTTP datatraffic. Although a conventional buffer stores both a request packet anda response packet in a single buffer without dividing each packet into aheader and a payload, the flow buffers used in the present inventioninclude the header buffer, the upstream content buffer and thedownstream content buffers in order to separately store the header andthe payload of the packet.

In this case, the flow storage unit 120 stores the address of theinternal data of a body corresponding to a first flow in a flow data mapinside a second flow when the internal data of the body corresponding tothe first flow is the same as the internal data of a body correspondingto the second flow. This is intended to increase the efficiency ofstorage space. To prevent the waste of storage space that occurs whenall redundant data is stored, when redundant data is present in theinternal body data of the response packets inside flows, the redundantdata is eliminated from a flow, and the address of the same data storedin another flow is stored in a flow data map inside the other flow. Thishas been described in detail with reference to FIG. 4.

Furthermore, metadata and index data corresponding to each flow aregenerated at step S740.

In this case, the metadata may include the IP address of a sender, theIP address of a recipient, the port address of the sender, the portaddress of the recipient, the internal address of a hard disk on whichthe flow has been stored, and the start time and end time of the flow,which correspond to the flow.

In this case, the index data may include the IP address of the sender,the IP address of the recipient, the port address of the sender, and theport address of the recipient.

In this case, the index data may include the IP address of the sender,the IP address of the recipient, the port address of the sender, and theport address of the recipient among the data included in the metadata.When the metadata is directly used to search for a flow, a reduction insearch speed may occur because the size of metadata is large.Accordingly, a reduction in search speed can be prevented using a methodof determining a search target flow using the index data in which partof the metadata has been stored and then fetching the address of thehard disk at which the flow has been stored using the metadata.

In this case, processing speed can be improved by storing the index dataand the metadata on an SSD, instead of the hard disks.

According to at least one embodiment of the present invention, datatraffic can be stored and searched for on the basis of a flow unitcomposed of packets, thereby further increasing storage and searchspeeds.

According to at least one embodiment of the present invention, datatraffic can be searched for based on two-step flow-based index data,thereby increasing search speed. 1001481 According to at least oneembodiment of the present invention, data traffic can be stored on aflow unit basis, other than a packet unit basis, thereby increasing theefficiency of communication and a disk write task.

An embodiment of the present invention may be implemented in a computersystem, e.g., as a computer readable medium. A computer system mayinclude one or more of a processor, a memory, a user input device, auser output device, and a storage, each of which communicates through abus. The computer system may also include a network interface that iscoupled to a network. The processor may be a central processing unit(CPU) or a semiconductor device that executes processing instructionsstored in the memory and/or the storage. The memory and the storage mayinclude various forms of volatile or non-volatile storage media. Forexample, the memory may include a read-only memory (ROM) and a randomaccess memory(RAM).

Accordingly, an embodiment of the invention may be implemented as acomputer implemented method or as a non-transitory computer readablemedium with computer executable instructions stored thereon. In anembodiment, when executed by the processor, the computer readableinstructions may perform a method according to at least one aspect ofthe invention.

The apparatus and method for storing data traffic on a flow basis andthe apparatus for searching for data traffic on a flow basis accordingto the present invention are not limited to the configurations andmethods of the above-desccribed embodiments, but some or all of theembodiments may be selectively combined such that the embodiments can bemodified in various manners.

What is claimed is:
 1. An apparatus for storing data traffic on a flowbasis, comprising: a packet storage unit configured to receive packetscorresponding to data traffic, and to temporarily store the packetsusing queues; a flow generation unit configured to generate flows bygrouping the packets by means of a hash function using information abouteach of the packets as input, and to store the flows; and a metadatageneration unit configured to generate metadata and index datacorresponding to each of the flows, and to store the metadata and theindex data
 2. The apparatus of claim 1, wherein the flow generation unitcomprises: a hash value generation unit configured to generate a hashvalue based on an IP address of each sender, an IP address of eachrecipient, a port address of the sender, and a port address of therecipient, which correspond to the packets; a generation unit configuredto sort the packets according to their flows based on the hash values,to generate flows by grouping the packets, and to store the flows inflow buffers; and a flow storage unit configured to store the flows,stored in the flow buffers, on hard disks.
 3. The apparatus of claim 2,wherein the flow storage unit stores each of the flows on the hard diskswhen a size of the flow stored in the flow buffers exceeds a specificvalue or the flow is terminated.
 4. The apparatus of claim 3, whereinthe flow buffers comprise: an upstream content buffer configured tostore a request packet; a header buffer configured to store a header ofa response packet corresponding to the request packet; and downstreamcontent buffers configured to store a body of the response packet. 5.The apparatus of claim 4, wherein the flow storage unit stores anaddress of internal data of a body corresponding to a first flow in aflow data map inside a second flow when the internal data of the bodycorresponding to the first flow is identical to internal data of a bodycorresponding to the second flow.
 6. The apparatus of claim 1, whereinthe metadata generation unit generates the metadata including an IPaddress of a sender, an IP address of a recipient, a port address of thesender, a port address of the recipient, an internal address of a harddisk on which the flow has been stored, and a start time and end time ofthe flow, which correspond to the flow, and the index data including theIP address of the sender, the IP address of the recipient, the portaddress of the sender, and the port address of the recipient, whichcorrespond to the flow.
 7. The apparatus of claim 6, wherein themetadata and the index data are stored on a solid state drive (SSD), andthe data traffic is stored on the hard disks.
 8. An apparatus forsearching for data traffic on a flow basis, comprising: a flow storageunit configured to store flows generated by arranging packetscorresponding to data traffic using information about each of thepackets and a hash function; a metadata storage unit configured to storemetadata and index data corresponding to each of the flows; and a searchunit configured to search for a flow stored in the flow storage unitbased on information about the flow.
 9. The apparatus of claim 8,wherein the search unit comprises a Bloom filter configured to store anIP address of a sender, an IP address of a recipient, a port address ofthe sender, and a port address of the recipient, which correspond to theflow.
 10. The apparatus of claim 9, wherein the search unit determineswhether a flow is present in the flow storage unit using any one of theIP address of the sender, the IP address of the recipient, the portaddress of the sender, and the port address of the recipient, whichcorrespond to the flow, and the Bloom filter.
 11. The apparatus of claim10, wherein the search unit, if it is determined using the Bloom filterthat the flow is present, searches for metadata corresponding to theflow using the index data and then searches for the flow based on themetadata.
 12. The apparatus of claim 11, wherein the flow storage unitstores the flows on hard disks.
 13. The apparatus of claim 12, whereinthe metadata storage unit stores the metadata and the index data on asolid state drive (SSD).
 14. A method of storing data traffic on a flowbasis, comprising: receiving packets corresponding to data traffic, andtemporarily storing the packets using queues; generating flows byarranging the packets using information about each of the packets and ahash function, and storing the flows; and generating metadata and indexdata corresponding to each of the flows.
 15. The method of claim 14,wherein generating the flows comprises: generating a hash value based onan IP address of each sender, an IP address of each recipient, a portaddress of the sender, and a port address of the recipient, whichcorrespond to the packets; generating flows by grouping the packetsbased on the hash values, and storing the flows in flow buffers; andstoring the flows, stored in the flow buffers, on hard disks.
 16. Themethod of claim 15, wherein storing the flows comprises storing each ofthe flows on the hard disks when a size of the flow stored in the flowbuffers exceeds a specific value or the flow is terminated.
 17. Themethod of claim 16, wherein the flow buffers comprise: an upstreamcontent buffer configured to store a request packet; a header bufferconfigured to store a header of a response packet corresponding to therequest packet; and downstream content buffers configured to store abody of the response packet.
 18. The method of claim 17, wherein storingthe flows comprises storing an address of internal data of a bodycorresponding to a first flow in a flow data map inside a second flowwhen the internal data of the body corresponding to the first flow isidentical to internal data of a body corresponding to the second flow.19. The method of claim 18, wherein generating the metadata and theindex data comprises generating the metadata including an IP address ofa sender, an IP address of a recipient, a port address of the sender, aport address of the recipient, an internal address of a hard disk onwhich the flow has been stored, and a start time and end time of theflow, which correspond to the flow, and the index data including the IPaddress of the sender, the IP address of the recipient, the port addressof the sender, and the port address of the recipient, which correspondto the flow.
 20. The method of claim 19, wherein generating the metadataand, the index data comprises storing the generated metadata and indexdata on a solid state drive (SSD).